package com.yzh.wanandroid.base

import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.MutableLiveData
import com.yzh.core.livedata.SingleLiveEvent
import com.yzh.wanandroid.model.RegistInfoData
import com.yzh.wanandroid.model.StateData
import com.yzh.wanandroid.network.retrofit.responsebean.BaseData
import com.yzh.wanandroid.network.retrofit.responsebean.LoginData
import com.yzh.wanandroid.network.retrofit.responsebean.UserInfo

interface IBaseUserRepository {

    /**
     * 获取用户信息
     */
    fun loadUserInfo(
        owner: LifecycleOwner,
        userInfoData: MutableLiveData<StateData<BaseData<UserInfo>>>
    )

    /**
     *  登录
     */
    fun login(
        owner: LifecycleOwner, username: String, password: String,
        loginData: SingleLiveEvent<StateData<BaseData<LoginData>>>
    )

    /**
     * 退出登录
     */
    fun logOut(owner: LifecycleOwner, logOutState: MutableLiveData<Int>)

    /**
     * 注册
     */
    fun register(
        owner: LifecycleOwner,
        username: String,
        password: String,
        repassword: String,
        register: SingleLiveEvent<StateData<RegistInfoData>>
    )
}